<?php /* @var $this Controller */ ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="language" content="en" />

	<!-- blueprint CSS framework -->
        <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/css/screen.css" media="screen, projection" />
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/css/print.css" media="print" />
	<!--[if lt IE 8]>
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/ie.css" media="screen, projection" />
	<![endif]-->

	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/css/main.css" />
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/css/form.css" />
                      
	<title><?php echo CHtml::encode($this->pageTitle); ?></title>
        
        <style type="text/css">
            .info ul{
                list-style-type: none;
            }
            .info li .flash-success{
                padding-left: 20px;
                background: url(images/s_success.png) center left no-repeat #E6EFC2;
            }
            
            .info li .flash-error{
                padding-left: 20px;
                background: url(images/s_error.png) center left no-repeat #FBE3E4;
            }
            
        </style>
        
</head>

<body>

<div class="container" id="page">

	<div id="header">
		<div id="logo"><?php echo CHtml::encode(Yii::app()->name); ?></div>
	</div><!-- header -->

	<div id="mainmenu">
		<?php $this->widget('zii.widgets.CMenu',array(
			'items'=>array(
				array('label'=>'Inicio', 'url'=>array('/site/index')),				
				array('label'=>'Iniciar sesión', 'url'=>array('/site/login'), 'visible'=>Yii::app()->user->isGuest),				
                                array('label'=>'Administrar mis minutas creadas', 'url' => array('minuta/admin'), 'visible' => Yii::app()->user->getName() != 'admin' && !Yii::app()->user->isGuest),
                                array('label'=>'Ver las minutas en las que participo', 'url' => array('minuta/adminMinutasEnLasQueParticipo'), 'visible' => Yii::app()->user->getName() != 'admin' && !Yii::app()->user->isGuest),
                                array('label'=>'Ver las minutas en las que soy responsable', 'url' => array('minuta/adminMinutasEnLasQueSoyResponsable'), 'visible' => Yii::app()->user->getName() != 'admin' && !Yii::app()->user->isGuest),
                                array('label'=>'Administrar usuarios', 'url' => array('usuario/admin'), 'visible' => Yii::app()->user->getName() == 'admin' && !Yii::app()->user->isGuest),
                                array('label'=>'Administrar departamentos', 'url' => array('departamento/admin'), 'visible' => Yii::app()->user->getName() == 'admin' && !Yii::app()->user->isGuest),
                                array('label'=>'Cerrar sesión ('.Yii::app()->user->name.')', 'url'=>array('/site/logout'), 'visible'=>!Yii::app()->user->isGuest),
			),
		)); ?>
	</div><!-- mainmenu -->
	<?php if(isset($this->breadcrumbs)):?>
		<?php $this->widget('zii.widgets.CBreadcrumbs', array(
			'links'=>$this->breadcrumbs,
                        'homeLink'=>CHtml::link('Inicio', array('/site/index')),
		)); ?><!-- breadcrumbs -->
	<?php endif?>       
               
        <div class='info' style='text-align:left;'>        
        <?php 
            
            $flashMessages = Yii::app()->user->getFlashes();
            if($flashMessages) {
                echo '<ul class="flashes">';
                foreach($flashMessages as $key => $message) {
                    echo '<li><div class="flash-'.$key.'">'.$message."</div></li>\n";
                }
                echo '</ul>';
            }
            
        ?>
        </div>
                
	<?php echo $content; ?>

	<div class="clear"></div>

	<div id="footer">
		Copyright &copy; <?php echo date('Y'); ?> by UADY.<br/>
		Todos los derechos reservados.<br/>
		<?php echo Yii::powered(); ?>
	</div><!-- footer -->

</div><!-- page -->

</body>
</html>